
    /**  
    * @Title: Template.java
    * @Package com.third.wx.gzh.util
    * @Description: 
    * @author likai
    * @date 2017年8月16日
    * @version V1.0  
    */
    
package com.third.base.wx;


import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.utils.date.DateUtil;

/**
    * @ClassName: Template
    * @Description: 微信公众号消息模板
    * @author likai
    * @date 2017年8月16日
    *
    */
public class WxGzhMsgTemplate{
	public static Logger log = LoggerFactory.getLogger(WxGzhMsgTemplate.class);
	/** 
     * 中奖结果通知
     * @param 
     * 接收人openid：touser
     * 头部信息：headinfo
     * 彩票名称：prizeName
     * 中奖奖励：prizeResult
     */  
	public static String prizeNotice(String touser,String headinfo,String prizeName,String prizeResult ) {
		String msg=
			"{\"touser\":\""+touser+"\","
	        +	"\"template_id\":\"4CVfjXC-0t2RqETdlH54bYxyEA-QozBY2oBAy2VtSAw\","  
	        +	"\"url\":\"http://www.eachpie.cn/\", "   	                
	        +"   \"data\":{"
	        +"         \"first\": {"
	        +"              \"value\":\""+headinfo+"\","
	        +"              \"color\":\"#f63434\""
	        +"           },"
			+"         \"keyword1\":{"
			+"              \"value\":\""+prizeName+"\"," 
			+"              \"color\":\"#8b8ae3\""
			+"           },"
			+"          \"keyword2\": {"
			+"              \"value\":\""+prizeResult+"\","
			+"              \"color\":\"#8b8ae3\""
			+"           },"
			+"          \"remark\":{"
			+"              \"value\":\"请立即点击进入,领取大奖吧\","
			+"              \"color\":\"#f63434\""
			+"          }"
			+"   }"
			+" }";
		return msg;
	}
	
	/** 
     * 任务处理通知
     * @param 
     * 接收人openid：touser
     * 头部信息：headinfo
     */  
	public static String taskNotice(String touser,String headinfo ) {
		String msg=
				"{\"touser\":\""+touser+"\","
		        +	"\"template_id\":\"SpL6lRhR_IKyCDqYEQXYtbX2S0-GGhIHWGdXg9njX64\","  
		        +	"\"url\":\"http://www.eachpie.cn/getUserPie.jhtml\", "   	                
		        +"   \"data\":{"
		        +"         \"first\": {"
		        +"              \"value\":\""+headinfo+"\","
		        +"              \"color\":\"#f63434\""
		        +"           },"
				+"         \"keyword1\":{"
				+"              \"value\":\"分享好友关注\"," 
				+"              \"color\":\"#8b8ae3\""
				+"           },"
				+"          \"keyword2\": {"
				+"              \"value\":\"分享成功\","
				+"              \"color\":\"#8b8ae3\""
				+"           },"
				+"          \"remark\":{"
				+"              \"value\":\"继续做任务，赚取更多派币\","
				+"              \"color\":\"#f63434\""
				+"          }"
				+"   }"
				+" }";
		log.info("taskNotice---------"+msg);
			return msg;
	}
	
	/** 
     * 系统通知
     * @param 
     * 接收人openid：touser
     * 头部信息：headinfo
     */  
	public static String sysNotice(String touser,String headinfo ) {
		String msg=
				"{\"touser\":\""+touser+"\","
		        +	"\"template_id\":\"vvZaJVuWNOqV-NoantwdExE5nyjELKkZYfcTTS_NF9E\","  
		        +	"\"url\":\"http://www.eachpie.cn/getUserPie.jhtml\", "   	                
		        +"   \"data\":{"
		        +"         \"first\": {"
		        +"              \"value\":\""+headinfo+"\","
		        +"              \"color\":\"#f63434\""
		        +"           },"
				+"         \"keyword1\":{"
				+"              \"value\":\"哎派商城维护通知\"," 
				+"              \"color\":\"#8b8ae3\""
				+"           },"
				+"          \"keyword2\": {"
				+"              \"value\":\"暂停关注功能\","
				+"              \"color\":\"#8b8ae3\""
				+"           },"
				+"          \"remark\":{"
				+"              \"value\":\"点击会员,完善信息,保障您的订单正常发货\","
				+"              \"color\":\"#f63434\""
				+"          }"
				+"   }"
				+" }";
		log.info("taskNotice---------"+msg);
			return msg;
	}
	
	/** 
     * 关注成功通知
     * @param 
     * 接收人openid：touser
     * 头部信息：headinfo
     */  
	public static String focusSuccess(String touser,String focusName,String headinfo ) {
		String msg=
				"{\"touser\":\""+touser+"\","
		        +	"\"template_id\":\"p3J7GtPpXkrPEXX7ZuRpHDFiMlBnM0FMJckjj8EvCbA\","  
		        +	"\"url\":\"https://w.url.cn/s/A6327Yt\", "   	                
		        +"   \"data\":{"
		        +"         \"first\": {"
		        +"              \"value\":\""+headinfo+"\","
		        +"              \"color\":\"#f63434\""
		        +"           },"
				+"         \"keyword1\":{"
				+"              \"value\":\""+focusName+"\"," 
				+"              \"color\":\"#8b8ae3\""
				+"           },"
				+"          \"keyword2\": {"
				+"              \"value\":\""+DateUtil.COMMON_FULL.getDateText(new Date())+"\","
				+"              \"color\":\"#8b8ae3\""
				+"           },"
				+"          \"remark\":{"
				+"              \"value\":\"点击分享好友赚取派币吧\","
				+"              \"color\":\"#f63434\""
				+"          }"
				+"   }"
				+" }";
		log.info("taskNotice---------"+msg);
			return msg;
	}
	
	/** 
     * 订单发货通知
     * @param 
     * 接收人openid：touser
     * 订单编号：orderNum
     * 物流名称：expressName
     * 物流单号：expressNum
     * 
     */  
	public static String orderExpressNotice(String touser,String orderNum,String expressName,String expressNum) {
		String msg=
				"{\"touser\":\""+touser+"\","
		        +	"\"template_id\":\"UbHnV4lixi5Ao-I7uudKLs5AAF6Ic0tQ21NycT4clnI\","  
		        +	"\"url\":\"http://www.eachpie.cn/\", "   	                
		        +"   \"data\":{"
		        +"         \"first\": {"
		        +"              \"value\":\"您兑换的商品已发货\","
		        +"              \"color\":\"#f63434\""
		        +"           },"
				+"         \"keyword1\":{"
				+"              \"value\":\""+DateUtil.COMMON_FULL.getDateText(new Date())+"\"," 
				+"              \"color\":\"#8b8ae3\""
				+"           },"
				+"          \"keyword2\": {"
				+"              \"value\":\"馅饼商城\","
				+"              \"color\":\"#8b8ae3\""
				+"           },"
				+"          \"keyword3\": {"
				+"              \"value\":\""+orderNum+"\","
				+"              \"color\":\"#8b8ae3\""
				+"           },"
				+"          \"keyword4\": {"
				+"              \"value\":\""+expressName+"\","
				+"              \"color\":\"#8b8ae3\""
				+"           },"
				+"          \"keyword5\": {"
				+"              \"value\":\""+expressNum+"\","
				+"              \"color\":\"#8b8ae3\""
				+"           },"
				+"          \"remark\":{"
				+"              \"value\":\"点击查看完整的物流信息\","
				+"              \"color\":\"#f63434\""
				+"          }"
				+"   }"
				+" }";
			return msg;
	}
	
	/** 
     * 订单生成通知
     * @param 
     * 接收人openid：touser
     * 订单编号：orderNum
     * 商品名称：goodsName
     */  
	public static String createOrderNotice(String touser,String orderNum,String goodsName) {
		String msg=
				"{\"touser\":\""+touser+"\","
		        +	"\"template_id\":\"e7AtiTKjbWp1Ou8bBwy4i2wfbPndJ8ywuO3_PAQaDr8\","  
		        +	"\"url\":\"http://www.eachpie.cn/getUserOrder.jhtml\", "   	                
		        +"   \"data\":{"
		        +"         \"first\": {"
		        +"              \"value\":\"您有新的订单生成\","
		        +"              \"color\":\"#f63434\""
		        +"           },"
				+"         \"keyword1\":{"
				+"              \"value\":\""+DateUtil.COMMON_FULL.getDateText(new Date())+"\"," 
				+"              \"color\":\"#8b8ae3\""
				+"           },"
				+"          \"keyword2\": {"
				+"              \"value\":\""+goodsName+"\","
				+"              \"color\":\"#8b8ae3\""
				+"           },"
				+"          \"keyword3\": {"
				+"              \"value\":\""+orderNum+"\","
				+"              \"color\":\"#8b8ae3\""
				+"           },"
				+"          \"remark\":{"
				+"              \"value\":\"订单成功\","
				+"              \"color\":\"#f63434\""
				+"          }"
				+"   }"
				+" }";
			return msg;
	}
	

	/** 
     * 发送客服消息
     * @param 
     * 接收人openid：touser
     * 头部信息：headinfo
     */  
	public static String customTxtMsg(String touser,String content ) {
		String msg=
				"{\"touser\":\""+touser+"\","
		        +	"\"msgtype\":\"text\","  
		        +"   \"text\":{"
		        +"         \"content\": \""+content+"\""
		        +		" }"
				+" }";
		log.info("taskNotice---------"+msg);
			return msg;
	}
	
}
